package presentacion;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class AgregarCicloDialog extends javax.swing.JDialog {
	private JLabel jLabel1;
	private JButton botonCrear;
	private JButton botonCancelar;
	private JTextField textNombreCiclo;

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}


	/**
	* Auto-generated main method to display this JDialog
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				JFrame frame = new JFrame();
				AgregarCicloDialog inst = new AgregarCicloDialog(frame);
				inst.setVisible(true);
			}
		});
	}
	
	public AgregarCicloDialog(JFrame frame) {
		super(frame);
		initGUI();
	}
	
	private void initGUI() {
		try {
			{
				jLabel1 = new JLabel();
				getContentPane().add(jLabel1, BorderLayout.CENTER);
				getContentPane().setLayout(null);
				this.setTitle("Crear Nuevo Ciclo");
				jLabel1.setText("Nombre:");
				jLabel1.setBounds(33, 36, 54, 22);
			}
			{
				textNombreCiclo = new JTextField();
				getContentPane().add(textNombreCiclo);
				textNombreCiclo.setBounds(93, 33, 198, 28);
			}
			{
				botonCrear = new JButton();
				getContentPane().add(botonCrear);
				botonCrear.setText("Crear");
				botonCrear.setBounds(87, 88, 89, 28);
				botonCrear.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent evt) {
						
						nombreCiclo = textNombreCiclo.getText();
						dispose();
						
					}
				});
			}
			{
				botonCancelar = new JButton();
				getContentPane().add(botonCancelar);
				botonCancelar.setText("Cancelar");
				botonCancelar.setBounds(188, 88, 92, 28);
				botonCancelar.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent evt) {
						// CANCELAR
						canceled = true;
						dispose();
					}
				});
			}
			this.setSize(379, 188);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	
	//CODIGO:
	
	
	private String nombreCiclo = null;

	
	private boolean canceled = false;
	

	public String getNombreCiclo() {
		return nombreCiclo;
	}

	public void setNombreCiclo(String nombreCiclo) {
		this.nombreCiclo = nombreCiclo;
	}
	
	public boolean isCanceled() {
		return canceled;
	}
	
	

}
